home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / nn.zip / NNUSAGE.SH < prev    next >
Text File  |  1989-12-31  |  421b  |  33 lines

  1. # CONFIG file is inserted here
  2.  
  3. if [ x"$1" = x'-t' ] ; then
  4.     SORTMODE="+1nr"
  5. else
  6.     SORTMODE=""
  7. fi
  8.  
  9. grep '^U:' $LIB/Log |
  10.  
  11. awk '
  12. BEGIN {
  13.     any=0
  14. }
  15. NF == 7 { 
  16.     if (split($7, t, ".") == 2) { 
  17.         u[$5] += t[1] * 60 + t[2]
  18.         any=1
  19.     }
  20. }
  21. END {
  22.     if (!any) {
  23.         printf("No usage statistics\n")
  24.         exit
  25.     }
  26.     for (n in u) {
  27.         name=substr(n, 2, length(n)-3)
  28.         printf("%-10.10s%8d.%02d\n", name, u[n]/60, u[n]%60);
  29.     }
  30. }' |
  31.  
  32. sort $SORTMODE
  33.